package buxter.api.commons;


/**
 * 
 * @author thijs.reus
 * @author andrei.martchouk
 * @author matthias.gall
 * @author natasha.martchouk
 * 
 */
public class ApiException extends Exception {
	/*
	 * Attributes from buxter.api.schema.ErrorResponse
	 */
	private String errorName;
	private String errorDetail;
	private String errorDescription;

	private static final long serialVersionUID = 1L;

	public ApiException() {
	}

	public ApiException(final String message) {
		super(message);
		this.errorDescription = message;
	}

	public ApiException(Throwable throwable) {
		super(throwable);
		this.errorName = throwable.getMessage();
	}

	public ApiException(final String errorName, final String errorDetail, final String errorDescription) {
		super(errorDescription);
		this.errorName = errorName;
		this.errorDetail = errorDetail;
		this.errorDescription = errorDescription;
	}

	public String toString() {
		return errorName + " : " + errorDetail+ " (" + errorDescription +")";
	}

	public String getErrorName() {
		return errorName;
	}

	public void setErrorName(String errorName) {
		this.errorName = errorName;
	}

	public String getErrorDetail() {
		return errorDetail;
	}

	public void setErrorDetail(String errorDetail) {
		this.errorDetail = errorDetail;
	}

	public String getErrorDescription() {
		return errorDescription;
	}

	public void setErrorDescription(String errorDescription) {
		this.errorDescription = errorDescription;
	}


}
